package com.lry.event;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import static com.lry.common.CommonConstants.COLON;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ProviderNodeWrapper {

    private String serviceName;

    private String implName;

    private String ip;

    private Integer weight;

    private String version;

    private String group;

    public String getHost(){
        String[] split = ip.split(COLON);
        return split[0];
    }
    public Integer getPort(){
        String[] split = ip.split(COLON);
        return Integer.valueOf(split[1]);
    }
}
